jQuery(function($){
    if(!placeholderSupport()){   // 判断浏览器是否支持 placeholder
        $('[placeholder]').each(function(){
            var input = $(this);
            if(input.attr("type")=="password"){
                input.attr("dbtype","password");
                input.attr("type","text");
            }
        });

        $('[placeholder]').focus(function() {
            var input = $(this);
            if(input.attr("dbtype")=="password"){
                input.attr("type","password");
            }

            if (input.val() == input.attr('placeholder')) {
                input.val('');
                input.removeClass('placeholder');
            }
        }).blur(function() {
                    var input = $(this);
                    if (input.val() == '' || input.val() == input.attr('placeholder')) {
                        if(input.attr("type")=="password"){
                            input.attr("type","text");
                        }
                        input.addClass('placeholder');
                        input.val(input.attr('placeholder'));
                    }
                }).blur();
    }
})
function placeholderSupport() {
    return 'placeholder' in document.createElement('input');
}
